﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sto5a00
    {
		private string _plistid;
		private string _checkadd;
        private int? _checktype;
		private string _productno;
		private double _qty;
		private string _barcode;
		private double _mqty1;
		private double _mqty2;
		private string _listid;
		
        /// <summary>
        /// 盘点号
        /// </summary>
		public string Plistid
		{
			get { return _plistid;	 }
			set { _plistid=value;	}
		}
        /// <summary>
        /// 盘点地址
        /// </summary>
		public string Checkadd
		{
			get { return _checkadd;	 }
			set { _checkadd=value;	}
		}
        /// <summary>
        /// 分类
        /// </summary>
		public int? Checktype
		{
			get { return _checktype;	 }
			set { _checktype=value;	}
		}
        /// <summary>
        /// 货号
        /// </summary>
		public string Productno
		{
			get { return _productno;	 }
			set { _productno=value;	}
		}
        /// <summary>
        /// 数量
        /// </summary>
		public double Qty
		{
			get { return _qty;	 }
			set { _qty=value;	}
		}
        /// <summary>
        /// 条码
        /// </summary>
		public string Barcode
		{
			get { return _barcode;	 }
			set { _barcode=value;	}
		}
        /// <summary>
        /// 修改数量1
        /// </summary>
		public double Mqty1
		{
			get { return _mqty1;	 }
			set { _mqty1=value;	}
		}
        /// <summary>
        /// 修改数量2
        /// </summary>
		public double Mqty2
		{
			get { return _mqty2;	 }
			set { _mqty2=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Sto5a00> GetSto5a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sto5a00> list = new List<Sto5a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sto5a00 model = GetSto5a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sto5a00 GetSto5a00ByDataRow(DataRow dr)
		{
			Sto5a00 model = new Sto5a00(); //实例化Sto5a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("plistid")&&!(dr["plistid"] is System.DBNull))  
				model.Plistid = ( string)dr["plistid"];
			if (dcc.Contains("checkadd")&&!(dr["checkadd"] is System.DBNull))  
				model.Checkadd = ( string)dr["checkadd"];
			if (dcc.Contains("checktype")&&!(dr["checktype"] is System.DBNull))  
				model.Checktype = ( int)dr["checktype"];
			if (dcc.Contains("productno")&&!(dr["productno"] is System.DBNull))  
				model.Productno = ( string)dr["productno"];
			if (dcc.Contains("qty")&&!(dr["qty"] is System.DBNull))  
				model.Qty = Convert.ToDouble(dr["qty"]);
			if (dcc.Contains("barcode")&&!(dr["barcode"] is System.DBNull))  
				model.Barcode = ( string)dr["barcode"];
			if (dcc.Contains("mqty1")&&!(dr["mqty1"] is System.DBNull))  
				model.Mqty1 = Convert.ToDouble(dr["mqty1"]);
			if (dcc.Contains("mqty2")&&!(dr["mqty2"] is System.DBNull))  
				model.Mqty2 = Convert.ToDouble(dr["mqty2"]);
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
